package com.yuwei.module_sign.viewmodel

import androidx.lifecycle.MutableLiveData
import com.bw.lib_common.vm.BaseViewModel2
import com.bw.lib_http.entity.SignEntity
import com.yuwei.module_sign.model.SignRepository
import kotlinx.coroutines.launch

class SignViewModel : BaseViewModel2<SignRepository>() {
    override fun createRepository(): SignRepository =  SignRepository()
    val getSignListSuccess by lazy {
        MutableLiveData<SignEntity>()
    }
    fun getSignList(){
        mViewModelScope.launch(mDispatcher){
            val result = mRepository.getSignList()
            if(result.code== 200){
                getSignListSuccess.postValue(result.data)
            }else{
                mErrorLiveData.postValue(result.message)
            }
        }

    }
}